Skip to content

label.py: Fix Label when initial text is not provided #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2021

Conversation

flavio-fernandes
Copy link
Contributor

This change addresses cases when Label class is initialized with
max_glyphs instead of text. In such cases, the split function is
attempted on None object instead of an empty string:

File "/lib/adafruit_display_text/label.py", line 84, in init
AttributeError: 'NoneType' object has no attribute 'split'

Fixes: #141

This change addresses cases when Label class is initialized with
max_glyphs instead of text. In such cases, the split function is
attempted on None object instead of an empty string:

  File "/lib/adafruit_display_text/label.py", line 84, in __init__
  AttributeError: 'NoneType' object has no attribute 'split'

Fixes: adafruit#141
@flavio-fernandes
Copy link
Contributor Author

@jposada202020 Please review this change!

@jposada202020
Copy link
Contributor

@flavio-fernandes
Thanks, I will , I will review tonigtht. Thanks for the contribution.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flavio-fernandes thank you for this fix!

These changes look good to me. I recreated the issue mentioned, and successfully tested these changes as a solution using Blinka_Displayio.

@FoamyGuy FoamyGuy merged commit f0a80b9 into adafruit:master Mar 13, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 14, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.16.0 from 2.15.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#133 from FoamyGuy/new_font
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#134 from jposada202020/tab_replacement
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#142 from flavio-fernandes/fix.init.wout.text

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.2.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#10 from kmatch98/switch_round
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#12 from FoamyGuy/adding_icon_widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label init with max_glyphs instead of text value is broken
3 participants